package org.casper.outofmemory;

public class TestJavaHeap {
	
	final static int size =2*1024*1024;
	
	/**
	 * 演示异常:java.lang.OutOfMemoryError: Java heap space
	 * 执行参数 -Xmx12m
	 * 解决方法：-Xmx2g
	 */
	public static void main(String[] args) {
		
		@SuppressWarnings("unused")
		int[] i = new int[size];
	}
}
